package com.yungui.libary.service.remote;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

@Service
public class RemoteCallService {
    //日志
    Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private RestTemplate restTemplate;

    public <T> T  callRemote(String url,Class<T> t){
        ResponseEntity<T> responseEntity = restTemplate.getForEntity(url,t);
        return responseEntity.getBody();
    }

}
